package com.cswangdao.controller.admin;

import com.cswangdao.result.Result;
import com.cswangdao.service.SystemService;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;

@RequestMapping("/admin/config/order")
@RestController
@Slf4j
public class AdminConfigOrderController {

    @Autowired
    private SystemService systemService;

    @GetMapping
    public Result<Map<String, Object>> doGet() {
        log.info("获取订单配置信息");
        Map<String, Object> map = systemService.getCofigExpress("market_order");
        return Result.success(map);
    }

    @PostMapping
    public Result doPost(@RequestBody Map<String, Object> map) {
        log.info("更新订单配置信息");
        systemService.updateBatch(map, "market_order");
        return Result.success();
    }
}
